package andriod;

import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by mofei on 16/1/21.
 */
public class BaiduApk {
    public void mySpider() throws IOException {
        Document doc = Jsoup.connect("http://shouji.baidu.com/game/?from=as").get();
        Elements nums=doc.select(".app-box");
        System.out.println("total:" + nums.get(0).text());
        System.out.println( nums.get(6).select(".name").attr("title"));
        System.out.println(nums.get(6).select(".down").get(0).text());
        System.out.println(nums.get(6).select(".size").get(0).text());
        System.out.println(nums.get(6).select(".brief").text());
        System.out.println(nums.get(6).getElementsByTag("img").attr("src"));
//        System.out.println( nums.get(1).select(".name").attr("title"));
//        Elements links = doc.select("a[href^=thread]");
    }

    public static void main(String[] args) throws IOException {
        BaiduApk demo=new BaiduApk();
        demo.mySpider();
    }
}
